//
//  GuideViewController.m
//  LoverGo
//
//  Created by yexiao on 14-9-15.
//  Copyright (c) 2014年 yexiao. All rights reserved.
//

#import "AppDelegate.h"
#import "GuideViewController.h"
#import "MainViewController.h"

@interface GuideViewController ()

@end

@implementation GuideViewController

- (void)viewDidAppear:(BOOL)animated {
    [self showIntroWithCrossDissolve];
}
- (void)showIntroWithCrossDissolve {
    EAIntroPage *page1 = [EAIntroPage page];
    page1.title = @"";
    page1.desc = @"";
    page1.bgImage = [UIImage imageNamed:@"guide_1.png"];
    page1.titleImage = nil;
    
    EAIntroPage *page2 = [EAIntroPage page];
    page2.title = @"";
    page2.desc = @"";
    page2.bgImage = [UIImage imageNamed:@"guide_2.png"];
    page2.titleImage = nil;
    
    EAIntroPage *page3 = [EAIntroPage page];
    page3.title = @"";
    page3.desc = @"";
    page3.bgImage = [UIImage imageNamed:@"guide_3.png"];
    page3.titleImage = nil;
    
    EAIntroPage *page4 = [EAIntroPage page];
    page4.title = @"";
    page4.desc = @"";
    page4.bgImage = [UIImage imageNamed:@"guide_4.png"];
    page4.titleImage = nil;
    
    EAIntroView *intro = [[EAIntroView alloc] initWithFrame:self.view.bounds andPages:@[page1,page2,page3,page4]];
    
    [intro setDelegate:self];
    [intro showInView:self.view animateDuration:0.0];
}
- (void)introDidFinish {
    NSUserDefaults *standard = [NSUserDefaults standardUserDefaults];
    [standard setBool:YES forKey:@"ISFIRST"];
    MainViewController *mainViewController = [[MainViewController alloc]init];
    AppDelegate *app = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    [app.window setRootViewController:mainViewController];
}
@end
